<template>
  <div class="block">
    <el-pagination
      class="pagination"
      background
      :current-page="pageNum"
      layout="total,sizes, prev, pager, next,jumper"
      :page-sizes="[12, 20, 50, 100]"
      :page-size="pageSize ? pageSize : 12"
      :total="pageTotal ? pageTotal : 0"
      @current-change="currentChange"
      @size-change="handleSizeChange"
    />
  </div>
</template>

<script>
export default {
  name: 'Index',
  props: {
    pageSize: {
      // 分页
      type: Number,
      default: 10
    },
    pageNum: {
      type: Number,
      default: 1
    },
    pageTotal: {
      type: Number,
      default: 0
    }
  },
  methods: {
    currentChange(page) {
      this.$emit('currentChange', page)
    },
    handleSizeChange(val) {
      this.$emit('sizeChange', val)
    }

  }
}
</script>

<style scoped lang="scss">
.pagination {
  margin-top: 15px;
}

</style>
